package com.cee.controller;

import com.cee.common.result.Result;
import com.cee.model.User;
import com.cee.service.ImportExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/upload")
public class ImportExcelController {


    @Autowired
    private ImportExcelService importExcelService;


    @RequestMapping("/importExcel")
    @ResponseBody
    public Result importExcel(@RequestParam("file") MultipartFile file) throws Exception {
        importExcelService.importExcel(file);
        return Result.ok();
    }
}
